FROM openjdk:8u342-slim

LABEL user="chris" mail="majewing@126.com" name="supreme-study-server" group="supreme-server"

ARG APP_NAME=supreme-study-server
ARG APP_VER=0.0.1
ARG APP_HOME=/home/${APP_NAME}
ARG TZ=Asia/Shanghai

RUN mkdir -p ${APP_HOME}
RUN mkdir -p ${APP_HOME}/temp-data

ARG JAR_FILE=${APP_NAME}-${APP_VER}.jar
ADD ${JAR_FILE} ${APP_HOME}/app-server.jar

RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone

EXPOSE 7230 7231

WORKDIR ${APP_HOME}

ENTRYPOINT ["java", "-server", "-jar", "app-server.jar", "--spring.profiles.active=docker"]